<template>
	<view>
		<view v-if="id == 3" class="">
			<view class="img">
				<image :src="imgUrl + logo" mode=""></image>
				<text>{{version}}</text>
			</view>
		</view>
		
		<view v-else class="plr-36">
			<rich-text :nodes="content"></rich-text>
		</view>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				id:'',
				content:'',
				logo:'',
				version:''
			}
		},
		onLoad(option) {
			this.id = option.id
			uni.setNavigationBarTitle({
				title: option.title
			});
			if(option.id == 3){
				this.initWe()
			}else {
				this.init()
			}
		},
		methods: {
			init(){
				this.$http('index/articleDetail',{
					id: this.id
				}).then(data=>{
					console.log(data);
					this.content = data.content
				})
			},
			initWe(){
				this.$http('index/siteAbout',{}).then(data=>{
					this.version = data.version
					this.logo = data.logo
				})
			}
		}
	}
</script>

<style lang="scss">
	.img {
		background-color: #f7f7f7;
		width: 300rpx;
		height: 300rpx;
		margin: auto;
		text-align: center;
		
		image {
			width: 100%;
			height: 100%;
			border-radius: 20rpx;
			margin: 30rpx 0;
		}
	}
</style>
